﻿using Hicap.QRCodeWarehouse.Core.Models.DbSet;
using Microsoft.EntityFrameworkCore;

namespace Hicap.QRCodeWarehouse.Core.EFCore
{
    public class WarehouseDbContext : DbContext
    {
        public DbSet<FileRepository> FilesRepository { get; set; }
        public DbSet<Product> Product { get; set; }
        public DbSet<GenerationRule> GenerationRule { get; set; }
        public DbSet<GenerationTask> GenerationTask { get; set; }
        public DbSet<MonitorHistory> MonitorHistory { get; set; }

        public WarehouseDbContext(DbContextOptions options)
            : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            // enable auto history functionality.
            modelBuilder.EnableAutoHistory(null);
            base.OnModelCreating(modelBuilder);
        }
    }
}